#include "dice.h"


dice::dice(void)
{
	srand(time(NULL));
	value = 0;
}

dice::dice(int value){
	srand(time(NULL));
	this->value = value;
}


dice::~dice(void)
{
}

void dice::throw_dice(){
	this->value = (rand() % 5) + 1;
}

void dice::read(){
	switch(value){
		case 1:
			cout << "-----" << endl << "!   !" << endl << "! X !" << endl << "!   !" << endl << "-----" << endl << endl;
			break;
		case 2:
			cout << "-----" << endl << "!X  !" << endl << "!   !" << endl << "!  X!" << endl << "-----" << endl << endl;
			break;
		case 3:
			cout << "-----" << endl << "!X  !" << endl << "! X !" << endl << "!  X!" << endl << "-----" << endl << endl;
			break;
		case 4:
			cout << "-----" << endl << "!X X!" << endl << "!   !" << endl << "!X X!" << endl << "-----" << endl << endl;
			break;
		case 5:
			cout << "-----" << endl << "!X X!" << endl << "! X !" << endl << "!X X!" << endl << "-----" << endl << endl;
			break;
		case 6:
			cout << "-----" << endl << "!X X!" << endl << "!X X!" << endl << "!X X!" << endl << "-----" << endl << endl;
			break;
		default:
			cout << "-----" << endl << "!   !" << endl << "!   !" << endl << "!   !" << endl << "-----" << endl << endl;
			break;
	}
}